.class public Lrexsee/core/widget/ProgressDiv;
.super Lrexsee/core/widget/Div;
.source "ProgressDiv.java"


# instance fields
.field private final mProgress:Landroid/widget/TextView;

.field private final mTrack:Landroid/widget/TextView;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 7
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    const/16 v6, 0x10

    const/4 v5, 0x1

    const/4 v4, -0x1

    const/4 v3, 0x0

    .line 18
    invoke-direct {p0, p1}, Lrexsee/core/widget/Div;-><init>(Landroid/content/Context;)V

    .line 19
    new-instance v1, Landroid/widget/TextView;

    invoke-direct {v1, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    .line 20
    new-instance v1, Landroid/widget/TextView;

    invoke-direct {v1, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    .line 21
    new-instance v0, Landroid/widget/FrameLayout;

    invoke-direct {v0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 22
    .local v0, "layout":Landroid/widget/FrameLayout;
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 23
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 24
    invoke-virtual {p0, v0}, Lrexsee/core/widget/ProgressDiv;->addDivChild(Landroid/view/View;)V

    .line 26
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    const-string v2, "width:fillparent;height:5px;font-size:12px;border-width:0px;label-padding:2 0 2 10;"

    invoke-virtual {v1, v2}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    .line 28
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v2, v4, v4}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 29
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v2, v5, v4}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 31
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v1, v6}, Landroid/widget/TextView;->setGravity(I)V

    .line 32
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setFocusable(Z)V

    .line 33
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setClickable(Z)V

    .line 34
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v1, v5}, Landroid/widget/TextView;->setSingleLine(Z)V

    .line 36
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v1, v6}, Landroid/widget/TextView;->setGravity(I)V

    .line 37
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setFocusable(Z)V

    .line 38
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setClickable(Z)V

    .line 39
    iget-object v1, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v1, v5}, Landroid/widget/TextView;->setSingleLine(Z)V

    .line 41
    return-void
.end method


# virtual methods
.method protected setProgressStyle()V
    .locals 11

    .prologue
    const/4 v10, -0x1

    const/4 v9, 0x0

    const-string v8, "px"

    const-string v7, ""

    .line 45
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->font_size:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v3

    const-string v4, "px"

    const-string v4, ""

    invoke-virtual {v3, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 46
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->font_size:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v3

    const-string v4, "px"

    const-string v4, ""

    invoke-virtual {v3, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 47
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getTypefaceStyle()I

    move-result v3

    invoke-virtual {v2, v9, v3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;I)V

    .line 48
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getTypefaceStyle()I

    move-result v3

    invoke-virtual {v2, v9, v3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;I)V

    .line 49
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getLabelPaddingLeft()I

    move-result v3

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v4}, Lrexsee/core/style/StyleSheet;->getLabelPaddingTop()I

    move-result v4

    iget-object v5, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v5}, Lrexsee/core/style/StyleSheet;->getLabelPaddingRight()I

    move-result v5

    iget-object v6, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v6}, Lrexsee/core/style/StyleSheet;->getLabelPaddingBottom()I

    move-result v6

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/widget/TextView;->setPadding(IIII)V

    .line 50
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getLabelPaddingLeft()I

    move-result v3

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v4}, Lrexsee/core/style/StyleSheet;->getLabelPaddingTop()I

    move-result v4

    iget-object v5, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v5}, Lrexsee/core/style/StyleSheet;->getLabelPaddingRight()I

    move-result v5

    iget-object v6, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v6}, Lrexsee/core/style/StyleSheet;->getLabelPaddingBottom()I

    move-result v6

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/widget/TextView;->setPadding(IIII)V

    .line 51
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    .line 52
    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->text_shadow_radius:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v3

    .line 53
    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v4, v4, Lrexsee/core/style/StyleSheet;->text_shadow_dx:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v4

    const-string v5, "px"

    const-string v5, ""

    invoke-virtual {v4, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v4

    .line 54
    iget-object v5, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v5, v5, Lrexsee/core/style/StyleSheet;->text_shadow_dy:Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "px"

    const-string v6, ""

    invoke-virtual {v5, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v5

    .line 55
    iget-object v6, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v6, v6, Lrexsee/core/style/StyleSheet;->text_shadow_color:Ljava/lang/String;

    invoke-static {v6}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v6

    .line 51
    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/widget/TextView;->setShadowLayer(FFFI)V

    .line 56
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    .line 57
    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->text_shadow_radius:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v3

    .line 58
    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v4, v4, Lrexsee/core/style/StyleSheet;->text_shadow_dx:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v4

    const-string v5, "px"

    const-string v5, ""

    invoke-virtual {v4, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v4

    .line 59
    iget-object v5, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v5, v5, Lrexsee/core/style/StyleSheet;->text_shadow_dy:Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "px"

    const-string v6, ""

    invoke-virtual {v5, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v5

    .line 60
    iget-object v6, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v6, v6, Lrexsee/core/style/StyleSheet;->text_shadow_color:Ljava/lang/String;

    invoke-static {v6}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v6

    .line 56
    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/widget/TextView;->setShadowLayer(FFFI)V

    .line 62
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->color:Ljava/lang/String;

    invoke-static {v3}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 63
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->mContext:Landroid/content/Context;

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v4, v4, Lrexsee/core/style/StyleSheet;->label_background_color:Ljava/lang/String;

    invoke-static {v3, v9, v4}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Landroid/content/Context;Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 65
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->progress_text_color:Ljava/lang/String;

    invoke-static {v3}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 66
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->mContext:Landroid/content/Context;

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v4, v4, Lrexsee/core/style/StyleSheet;->progress_color:Ljava/lang/String;

    invoke-static {v3, v9, v4}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Landroid/content/Context;Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 68
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->progress:Ljava/lang/String;

    const-string v3, "%"

    const-string v4, ""

    invoke-virtual {v2, v3, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    .line 69
    .local v0, "progressInt":I
    const/16 v2, 0x64

    if-lt v0, v2, :cond_1

    move v1, v10

    .line 70
    .local v1, "width":I
    :goto_0
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    new-instance v3, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v3, v1, v10}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 71
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v2}, Landroid/widget/TextView;->getHeight()I

    move-result v2

    int-to-float v2, v2

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v3}, Landroid/widget/TextView;->getTextSize()F

    move-result v3

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v4}, Landroid/widget/TextView;->getPaddingTop()I

    move-result v4

    int-to-float v4, v4

    add-float/2addr v3, v4

    iget-object v4, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    invoke-virtual {v4}, Landroid/widget/TextView;->getPaddingBottom()I

    move-result v4

    int-to-float v4, v4

    add-float/2addr v3, v4

    cmpl-float v2, v2, v3

    if-ltz v2, :cond_0

    .line 72
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->label:Ljava/lang/String;

    invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 73
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mProgress:Landroid/widget/TextView;

    iget-object v3, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->label:Ljava/lang/String;

    invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 76
    :cond_0
    invoke-virtual {p0}, Lrexsee/core/widget/ProgressDiv;->setDivStyle()V

    .line 78
    return-void

    .line 69
    .end local v1    # "width":I
    :cond_1
    iget-object v2, p0, Lrexsee/core/widget/ProgressDiv;->mTrack:Landroid/widget/TextView;

    invoke-virtual {v2}, Landroid/widget/TextView;->getWidth()I

    move-result v2

    mul-int/2addr v2, v0

    div-int/lit8 v2, v2, 0x64

    move v1, v2

    goto :goto_0
.end method

.method protected setProgressStyle(Ljava/lang/String;)V
    .locals 1
    .param p1, "style"    # Ljava/lang/String;

    .prologue
    .line 80
    iget-object v0, p0, Lrexsee/core/widget/ProgressDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v0, p1}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    .line 81
    invoke-virtual {p0}, Lrexsee/core/widget/ProgressDiv;->setProgressStyle()V

    .line 82
    return-void
.end method

.method public setStyle(Ljava/lang/String;)V
    .locals 0
    .param p1, "style"    # Ljava/lang/String;

    .prologue
    .line 85
    invoke-virtual {p0, p1}, Lrexsee/core/widget/ProgressDiv;->setProgressStyle(Ljava/lang/String;)V

    .line 86
    return-void
.end method
